Skip to main content

Parameter Parsing

Create and Update command will evaluate parser parameter from cloud-code script.

Look at sample Script.js, parameter with name range and type NUMERIC are parsed and uploaded to dashboard.

For more details, please check Declare parameters in the script.

Parsing Limitations

Invalid Java Script Logic

Although Create and Update command parse and evaluate cloud code script, it does not detect invalid logic. For example:

const _ = require("lodash-4.17");

const NUMBER_OF_SIDES = 6;

module.exports.params = {
sides: "NUMERIC"
};

module.exports = async ({ params, context, logger }) => {
...
};

// Functions can exist outside of the script wrapper
function rollDice(sides) {
return _.random(1, sides);
}

Although the script above have module.exports.params in code, it is overwritten by module.exports = async .... As a result it will have no parameter parsed.